import { observable, action } from 'mobx'
import { ajax } from '../../api'

class Produce {
    // 产品列表
    @observable producelist: Array<object> = []
    // 异步
    @action cproducelist = async (payload: any) => {
        let { code, result }: any = await ajax.producelist(payload)
        if (code === 200) {
            this.producelist = result;
            
        }
    }
    // 查询
    @action sproduce = async (payload: any) => {
        let { code, result }: any = await ajax.producelist(payload)
        if (code === 200) {
            this.producelist = result;
        }
    }
    // 同步
    @action getproducelist = (payload:any)=>{
        this.producelist = payload
    }
}
export default new Produce()